const app = getApp();

Page({
  data: {

  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function () {

  },

  onShow:function(){
    var store_id = wx.getStorageSync("store_id");
    console.log(store_id)
    if(!store_id){
      app.showToast("请登录小程序")
      wx.navigateBack();
    }else{
      this.setData({
        store_id:wx.getStorageSync("store_id")
      })
      this.tableList();
    }
  },

  tableList:function(){
    var t = this;
    app.visit("account/tableList", {
      store_id:t.data.store_id
    }, "", function(c) {
      console.log(c)
      if(0 == c.code){
        t.setData({
          list:c.data
        })
      }else{
        app.showToast(c.msg)
      }
    })
  },
  zhuotaiinfo: function (e) {
    var table_id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: 'zhuotaiinfo?table_id='+table_id
    });
  },
  bangdingmp: function(e) {
    wx.navigateTo({
      url: 'bangdingmp'
    });
  },

});